//
//  UIButton+Extension.swift
//  weibo117
//
//  Created by 宋禹奇 on 15/7/9.
//  Copyright © 2015年 宋禹奇. All rights reserved.
//

import UIKit

extension UIButton {

    convenience init(title: String, imageName: String, fontSize: CGFloat, titleColor: UIColor = UIColor.darkGrayColor()){
        
        self.init()
        
        setTitle(" " + title, forState: UIControlState.Normal)
        setImage(UIImage(named: imageName), forState: UIControlState.Normal)
        setTitleColor(titleColor, forState: UIControlState.Normal)
        titleLabel?.font = UIFont.systemFontOfSize(fontSize)
  
    }
    
    convenience init(title: String, fontSize: CGFloat, titleColor: UIColor = UIColor.darkGrayColor(), bgColor:UIColor = UIColor.brownColor()){
        
        self.init()
        
        setTitle(" " + title, forState: UIControlState.Normal)
        setTitleColor(titleColor, forState: UIControlState.Normal)
        titleLabel?.font = UIFont.systemFontOfSize(fontSize)
        backgroundColor = bgColor
        
    }

 
}
